package au.org.arcs.dss.provider.datasource.provider.factory;

import au.org.arcs.dss.provider.ConfigManager;
import au.org.arcs.dss.provider.datasource.provider.ProviderAccount;
import au.org.arcs.dss.provider.datasource.provider.irods.IRODSAccountMetaData;

/**
 *
 * @author ming
 */
public class ProviderAccountFactory {
  public static ProviderAccount getInstance() {
    ProviderAccount account = new IRODSAccountMetaData();

    account.setValue(IRODSAccountMetaData.IRODS_PREFIX, ConfigManager.getConfigManagerInstance().getIrodsPrefix());
    account.setValue(IRODSAccountMetaData.IRODS_DEFAULT_RESOURCE, ConfigManager.getConfigManagerInstance().getIrodsDefaultResource());
    account.setValue(IRODSAccountMetaData.IRODS_HOST, ConfigManager.getConfigManagerInstance().getIrodsHost());
    account.setValue(IRODSAccountMetaData.IRODS_PASSWORD, ConfigManager.getConfigManagerInstance().getIrodsPassword());
    account.setValue(IRODSAccountMetaData.IRODS_PORT, String.valueOf(ConfigManager.getConfigManagerInstance().getIrodsPort()));
    account.setValue(IRODSAccountMetaData.IRODS_USERNAME, ConfigManager.getConfigManagerInstance().getIrodsUsername());
    account.setValue(IRODSAccountMetaData.IRODS_ZONE, ConfigManager.getConfigManagerInstance().getIrodsZone());

    return account;
  }
}
